package ch2;

/**
 * /**
 * * VM Args：-Xss128k
 * *
 */
public class P2_JavaVMStackSOF {

        private int stackLength = 1;
        public void stackLeak() {
            stackLength++;
            stackLeak();
        }
        public static void main(String[] args) throws Throwable {
            P2_JavaVMStackSOF oom = new P2_JavaVMStackSOF();
            try {
                oom.stackLeak();
            } catch (Throwable e) {
                System.out.println("stack length:" + oom.stackLength);
                throw e;
            }
        }
}
